/*
 * @Description:构造函数模式
 * @Author: admin
 * @Date: 2021-06-08 17:11:40
 * @LastEditors: admin
 * @LastEditTime: 2021-06-08 17:12:58
 */
function Person (name, age, job) {
  this.name = name;
  this.age = age;
  this.job = job;
  this.sayName = function () {
    alert(this.name)
  }
}

var p1 = new Person("larry", 22, "boss");
var p2 = new Person("terry", 19, "bigBoss");
console.log(typeof p1);
console.log(p1 instanceof Object);
console.log(p1 instanceof Person);